package cn.kmsoft.jssc.entity.mq;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import java.io.Serializable;

@JsonIgnoreProperties(ignoreUnknown = true)
public class MqMessage implements Serializable {
    private String msgId;
    private String hostId;
    private String jobId;
    private int jobStatusCode = 0;
    private String jobStatus;//0=未执行，1=执行中，2=执行完毕，-1=取消
    private String modelName;
    private String subProcessName;
    private int processValue;
    private String msgContent;

    public MqMessage() {
    }

    public MqMessage(String hostId, String jobId, String modelName, int processValue) {
        this.hostId = hostId;
        this.jobId = jobId;
        this.modelName = modelName;
        this.processValue = processValue;
    }

    public String getMsgId() {
        return msgId;
    }
    public void setMsgId(String msgId) {
        this.msgId = msgId;
    }

    public String getHostId() {
        return hostId;
    }
    public void setHostId(String hostId) {
        this.hostId = hostId;
    }

    public String getJobId() {
        return jobId;
    }
    public void setJobId(String jobId) {
        this.jobId = jobId;
    }

    public String getModelName() {
        return modelName;
    }
    public void setModelName(String modelName) {
        this.modelName = modelName;
    }

    public String getSubProcessName() {
        return subProcessName;
    }
    public void setSubProcessName(String subProcessName) {
        this.subProcessName = subProcessName;
    }

    public int getProcessValue() {
        return processValue;
    }
    public void setProcessValue(int processValue) {
        if (processValue > 100) {
            this.processValue = processValue % 100;
        } else {
            this.processValue = processValue;
        }
    }

    public String getMsgContent() {
        return msgContent;
    }
    public void setMsgContent(String msgContent) {
        this.msgContent = msgContent;
    }

    public int getJobStatusCode() {
        return jobStatusCode;
    }
    public void setJobStatusCode(int jobStatusCode) {
        this.jobStatusCode = jobStatusCode;
    }

    public String getJobStatus() {
        return jobStatus;
    }
    public void setJobStatus(String jobStatus) {
        this.jobStatus = jobStatus;
    }

    @Override
    public String toString() {
        return "MqMessage [msgId=" + msgId + ", hostId=" + hostId + ", jobId=" + jobId + ", jobStatusCode="
                + jobStatusCode + ", jobStatus=" + jobStatus + ", modelName=" + modelName + ", subProcessName="
                + subProcessName + ", processValue=" + processValue + ", msgContent=" + msgContent + "]";
    }
}